package cn.itsource.hrm.annotation;

import cn.itsource.hrm.errorcode.ErrorCode;
import cn.itsource.hrm.util.AssertUtils;
import cn.itsource.hrm.util.ValidatorUtils;
import org.springframework.util.StringUtils;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

public class MobileConstraintValidator implements ConstraintValidator<Mobile, String> {

    //value 要检验的值
    @Override
    public boolean isValid(String value, ConstraintValidatorContext context) {
        return StringUtils.isEmpty(value) && ValidatorUtils.isMobile(value) ;
    }
}
